package util
{
	//随机数
	
	public class RandomUtil
	{
		public function RandomUtil()
		{
		}
		
		public static function randomArray():Array
		{
			var num_arr:Array = new Array();  
			var j:uint = 0;  
			var judge:uint = 0;  
			do {  
				var temp_num:uint = Math.round(Math.random()*100);  
				for (var i:uint = 0; i<num_arr.length; i++) {  
					var temp_n:uint = num_arr[i];  
					if (temp_num == temp_n) {  
						judge = 1;  
						break;  
					} else {  
						judge = 0;  
					}  
				}  
				if (judge == 0) {  
					num_arr.push(temp_num);  
					j++;   
				}  
			} while (j<100);  
			
			return num_arr;
		}
		
		public static function randomRange(min:Number, max:Number):Number
		{
			var randomNum:Number = Math.floor(Math.random() * (max - min + 1)) + min;
			return randomNum;

		}
	}
}